//
//  TestModel.m
//  Rac
//
//  Created by ios on 2017/3/17.
//  Copyright © 2017年 Wy. All rights reserved.
//

#import "TestModel.h"
#import "ViewController.h"
#import "HeadView.h"

@implementation TestModel


-(instancetype)init{
    self = [super init];
    if (self) {
        [self initViewModel];
       
    }
    return self;
}

-(void)initViewModel{
    
    @weakify(self);
    self.refreshCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal * _Nonnull(id  _Nullable input) {
        @strongify(self)
        
        HeadView *view  = input;
        
        view.bgLabel.text = @"初始化";
        
        return [RACSignal empty];
        
    }];
    
    self.btnCommand   = [[RACCommand alloc] initWithSignalBlock:^RACSignal * _Nonnull(id  _Nullable input) {
    
        UITextField *textfield = input;
        
        textfield.text = @"修改了";
        
         return [RACSignal empty];
    }];
    
}

@end
